package com.heima.api.schedule;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dtos.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient("leadnews-schedule")
public interface ScheduleClient {

    @PostMapping("/api/v1/schedule/addTask")
    public ResponseResult addTask(Task task);

    @GetMapping("/api/v1/schedule/cancelTask")
    public ResponseResult cancelTask(Long taskId);

    @GetMapping("/api/v1/task/{type}/{priority}")
    public ResponseResult poll(@PathVariable("type") int type, @PathVariable("priority") int priority);

}